import request from '@/utils/request'

export function getSubject(params) {
  return request({
    // url: '/subjects',
    url: '/subjects',
    method: 'get',
    params
  })
}
// 新增学科的请求

export function addsub(data) {
  return request({
    // url: '/subjects',
    url: '/subjects',
    method: 'post',
    data
  })
}
// 删除学科按钮
export function deleteSubject(id) {
  return request({
    url: `/subjects/${id}`,
    method: 'delete'
  })
}

// 修改学科按钮
export function alterSubject(data) {
  // console.log(data.id)
  return request({
    url: `/subjects/${data.id}`,
    method: 'put',
    data
  })
}
